package com.yangxc.core.log.config;

import com.yangxc.core.log.aspect.LogAspect;
import com.yangxc.core.log.service.LogService;
import com.yangxc.core.log.service.impl.DefaultLogServiceImpl;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author yangxc
 * @version 1.0.0
 * @ClassName LogAutoConfiguration.java
 * @Description TODO
 * @createTime 2021年07月02日 11:09:00
 */
@Configuration
@ConditionalOnWebApplication
public class LogAutoConfiguration {

    @Bean
    public LogAspect logAspect(){
        return new LogAspect();
    }
    
    @Bean
    @ConditionalOnMissingBean
    public LogService logService() {
      return new DefaultLogServiceImpl();
    }
}
